home *** CD-ROM | disk | FTP | other *** search
/ Compendium Deluxe 2 / LSD and 17bit Compendium Deluxe - Volume II.iso / a / prog / asmsrc / rebelssource.lha / Sources / LINES.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1994-07-09  |  2.1 KB  |  82 lines

  1.  
  2. (* Nice Line Effect done by Zulu & Grey of Rebels *)
  3.  
  4. Program DoItYourSelf_HausBau;
  5.  
  6. uses     graph,crt;
  7.  
  8. const    xstart=20;
  9.          ystart=30;
  10.          xstop=630;
  11.          ystop=400;
  12.  
  13. var      x1,y1,x2,y2,color,number,realline,point,high,length:integer;
  14.          treib,modus:integer;
  15.          maxx:word;
  16.          taste:char;
  17.  
  18.  
  19. begin                            
  20.          clrscr;
  21.  
  22.          randomize;
  23.  
  24.          treib:=detect;
  25.          initgraph(treib,modus,'a:\tp');
  26.  
  27.          color:=random(15-1);
  28.          setcolor(color);
  29.          line(xstart,ystop,xstart,ystart);
  30.          line(xstart,ystart,xstop,ystart);
  31.          color:=random(15-1);
  32.          setcolor(color);
  33.          line(xstop,ystart,xstop,ystop);
  34.          line(xstop,ystop,xstart,ystop);
  35.  
  36.          realline:=(ystop-ystart)+(xstop-xstart);
  37.          high:=ystop-ystart;
  38.          length:=xstop-xstart;
  39.  
  40.          repeat
  41.  
  42.          color:=random(15-1);
  43.          setcolor(color);
  44.  
  45.          point:=random(realline);
  46.  
  47.          if point<=high then begin
  48.                              x1:=xstart+1;
  49.                              y1:=ystart+1+point;
  50.                              if y1>=ystop then y1:=ystop-1;
  51.                              end;
  52.  
  53.          if point>high then begin
  54.                             x1:=xstart+1+point-high;
  55.                             y1:=ystart+1;
  56.                             if x1>=xstop then x1:=xstop-1;
  57.                             end;
  58.  
  59.          point:=random(realline);
  60.  
  61.          if point>high then begin
  62.                             x2:=xstart+1+point-high;
  63.                             y2:=ystop-1;
  64.                             if x2>=xstop then x2:=xstop-1;
  65.                             end;
  66.  
  67.          if point<=high then begin
  68.                              x2:=xstop-1;
  69.                              y2:=ystart+1+point;
  70.                              if y2>=ystop then y2:=ystop-1;
  71.                              end;
  72.          (* sound(2000+x1+x2+y1+y2); *)
  73.          line(x1,y1,x2,y2);
  74.          delay(10);
  75.          (*nosound;*)
  76.  
  77.          until keypressed;
  78.  
  79.          closegraph;
  80. end.
  81.  
  82.